home *** CD-ROM | disk | FTP | other *** search
- Path: news.cc.uic.edu!sunphy1!olczyk
- From: olczyk@sunphy1 (Lambert Schoonveld)
- Newsgroups: comp.lang.c++,comp.lang.pascal.delphi.misc
- Subject: Re: C++ with Zapp vs. Delphi
- Followup-To: comp.lang.c++,comp.lang.pascal.delphi.misc
- Date: 22 Jan 1996 23:07:12 GMT
- Organization: University of Illinois at Chicago
- Message-ID: <4e15b0$1g68@tigger.cc.uic.edu>
- References: <4coar6$d4n@sun4.bham.ac.uk> <4coip7$69s@news1.usa.pipeline.com> <DBk8wg2yqjbB083yn@iaccess.za> <4d7pmb$48c8@tigger.cc.uic.edu> <4dk38h$gdr@merlin.delphi.com> <4dksp1$3d6c@tigger.cc.uic.edu> <30fe666e.3349285@130.15.126.54> <4durk2$2r54@tigger.cc.uic.edu> <31038877.2364473@130.15.126.54>
- NNTP-Posting-Host: sunphy1.phy.uic.edu
- X-Newsreader: TIN [version 1.2 PL2]
-
- Duncan Murdoch (dmurdoch@mast.queensu.ca) wrote:
- : olczyk@sunphy1 (Constantin Rasinariu) wrote:
-
- : >Duncan Murdoch (dmurdoch@mast.queensu.ca) wrote:
-
- : >: There's not a big difference, but I think this is a little bit
- : >: preferable. It makes it clear that it's up to the list to know about
- : >: sorting, not up to the object. That way you can easily put the same
- : >: object in multiple lists with different sorting rules.
- : >Try
- : >class A:SortedObject (CompareTo not overridden)
- : >class B: A ( override with first comparison )
- : >class C: A (override second comparison )
-
- : This won't work. Each object will still have some class, be it B or
- : C. It'll end up sorted on one comparison or the other. What I want
- : is to have two lists (say AlphaList and NumericList) and put
- : references to the same object in both lists. The first would end up
- : sorted alphabetically, the second numerically.
-
- class A:SortedObject
- {
- ....
- public:
- A *a;
- A()
- { ...
- a=0;
- }
- };
-
-
-
- The CompareTo's have to test a for 'nillness', but should work accordingly.
-
- In your method what if the comparison needs to use private data in the object?
-
-
- : >OK. Try this one.
- : >You have a class, call it model which contains data and a list
- : >of objects that derive from a 'view' class. Each 'view' class must
- : >derive from a component. Each view class must received new data as it is
- : >modified in model. Model must recieve data from the view class as it
- : >is changed in the view.
- : >How do you implement this?
-
- : I'm sorry, but I'm not sure what you're asking. Can you state the
- : problem in more generic terms, without assuming your solution?
- : Remember, I'm reading this in the Delphi group, and I'm not
- : particularly familiar with C++ jargon.
-
- Strange since it's basis is in Smalltalk.
- You have a class called model. It's purpose is to hlod data of some
- form ( say a record in a database). You have a set of classes
- called 'views' (say dataaware components). When you create a view
- it is associated to a model object. When the data stored in the model object
- changes, it updates the views. When a view changes it updates the model.
- ---------------------------
- Thaddeus L. Olczyk
-